package src.clientSide;

import java.util.List;

import src.dataStructures.Data;
import src.dataStructures.User;


/**
 * This class contains connection points for messages from the the server
 * @author John Stewart
 */
public class MessageIn {
	
	/**
	 * This method sets the current user to the object given
	 * @param user The new current user
	 */
	public static void giveCurrentUser(User user) {
		LocalData.currentuser = user;
		System.out.println("New Current User:\n"+user.toString()+"\n");
	}
	
	/**
	 * This method sets a new data object
	 * @param data The new data object for the system to use
	 */
	public static void giveData(Data data) {
		LocalData.data = data;
		System.out.println("New Data:\n"+data.toString()+"\n");
	}

	/**
	 * This method sets a new list of data objects
	 * @param datalist The new list of data objects for the system to use
	 */
	public static void giveDataList(List<Data> datalist) {
		LocalData.datalist = datalist;
		System.out.println("New Current User:");
		for (Data data : datalist) System.out.println(data.toString());
		System.out.println();
	}
	
	/**
	 * This method call indicates that the password entered was incorrect
	 */
	public static void invalidPasswordError() {
		System.out.println("The password entered was incorrect\n");
	}
	
	/**
	 * This method call indicates that the user was unable to login due to a locked account
	 * To unlock, wait or have an admin unlock the account
	 */
	public static void lockedLoginError() {
		System.out.println("The user was unable to login due to a locked account\n");
	}
	
	/**
	 * This method call indicates that the client attempted to create an account with a used user name
	 */
	public static void nameTakenError() {
		System.out.println("Attempted to create an account with a used user name\n");
	}
	
	/**
	 * This method call indicates that the client attempted to use a user name that does not exist
	 */
	public static void nonexistantNameError() {
		System.out.println("Attempted to use a user name that does not exist\n");
	}
	
	/**
	 * This is the "do nothing" return command
	 */
	public static void nullMessage() {
		System.out.println("Null Message\n");
	}
	
	/**
	 * This method call indicates that the client attempted to create a password with improper format
	 */
	public static void passwordFormatError() {
		System.out.println("Attempted to create a password with improper format\n");
	}
	
	/**
	 * This method call indicates that the client attempted to create a user name with improper format
	 */
	public static void userNameFormatError() {
		System.out.println("Attempted to create a user name with improper format\n");
	}
	
}
